﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NetPong.PongClassesCore;
using Microsoft.Xna.Framework.Graphics;
using FarseerGames.FarseerPhysics;
using Microsoft.Xna.Framework;
using XNALibrary;

namespace NetPong.PongClasses3d
{
    public class Level3d : Level
    {
        public Body3d rigidBody;

        public Level3d(Model m, PhysicsSimulator ps)
            : base(ps)
        {
            rigidBody = new Body3d(m, GetBody);
            rigidBody.pitch = MathHelper.ToRadians(30);
            //rigidBody.GetBody().Rotation = MathHelper.ToRadians(45);
            rigidBody.Scale = .125f;
            //do scale calculations for model here 
        }

        public override void Render(RenderControl rc, Microsoft.Xna.Framework.GameTime gt)
        {
            CullMode cm = rc.graphicsDevice.RenderState.CullMode;
            rc.graphicsDevice.RenderState.CullMode = CullMode.None;
            rigidBody.Render(rc, gt);
            rc.graphicsDevice.RenderState.CullMode = cm;
        }
    }
}
